<div id="notification_detail" class="modal fade">
  <div class="modal-dialog" >
    <div class="modal-content">
    	<div class="modal-header">
          <button type="button" class="close" data-dismiss="modal"><span aria-hidden="true">&times;</span><span class="sr-only">Close</span></button>
          <h4 class="modal-title">新增公告</h4>
      </div>
      <div class="modal-body">
				<div class="row">
					<form id="notification_form" action='{:U("Admin/District/updateNotification")}' method="post">
					<div class="form-group">
						<div class="col-sm-12">
				  		<div class="col-sm-1"></div>
					    <div class="col-sm-3" style="padding-left:15px;padding-top:5px">
								<label for="index" class="control-label">排序：</label>
							</div>
							<div class="col-sm-6">
								<input id="index" name="index" class="form-control"></input>
							</div>
						</div>

						<div class="col-sm-12">
							<br>
							<div class="col-sm-1"></div>
							<div class="col-sm-3" style="padding-left:15px;padding-top:5px">
								<label for="title" class="control-label">公告名称：</label>
							</div>
							<div class="col-sm-6">
								<input id="title" name="title" class="form-control"></input>
							</div>
						</div>

						<div class="col-sm-12">
				  		<br>
				  		<div class="col-sm-1"></div>
					    <div class="col-sm-3" style="padding-left:15px;padding-top:5px">
								<label for="content" class="control-label">公告内容：</label>
							</div>
							<div class="col-sm-6">
								<textarea id="content" name="content" class="form-control" style="height:100px"></textarea>
							</div>
						</div>

					</div>
					</form>
				</div>
			</div>
			<div class="modal-footer">
        <button class="btn btn-primary" onclick="submit()">保存</button>
        <button class="btn btn-defalt" data-dismiss="modal">取消</button>
    	</div>
		</div>
	</div>
</div>
<script>

$('#notification_detail').on("hidden.bs.modal",function(e){
  district_id = '';
	district_notification_id = '';
	$("input[name='index']").attr('value', '');
  $("input[name='title']").attr('value', '');
  $("textarea[name='content']").html('');
}); 

function submit(){

  $('#notification_form').ajaxSubmit({
  		data:{
  			district_id : district_id,
  			district_notification_id : district_notification_id
  		},
      success:function(data){
          $('#notification_detail').modal('hide');
          location.reload();
      }
  });
}
	
</script>